#ifndef __E7BE74E6_0971_4e10_9640_0B9C3654D28A__
#define __E7BE74E6_0971_4e10_9640_0B9C3654D28A__

#include "../import/head.h"
#include "../tools/head.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 

namespace xos
{
    // 
    // misc_impl
    // 
    class misc_impl : public xos_stl::mem_pool_item< misc_impl, thread_lock >,
        public i_misc
    {
    public:
        misc_impl();
        ~misc_impl();

    public:
        int init();
        int term();

    public:
        // 
        // utf8 to wchar
        // 
        int utf8_to_wchar( const char * lpszSrc, int nSrcByteSize, wchar_t * lpszDest, int nDestByteSize, int * lpnDestNeedSize );

        // 
        // wcharto utf8
        // 
        int wchar_to_utf8( const wchar_t * lpszSrc, int nSrcByteSize, char * lpszDest, int nDestByteSize, int * lpnDestNeedSize );

        // 
        // get process full file name
        // 
        int get_process_file_full_name( char * pszFile, int nLen, int * pnLenNeeded );

        // 
        // get process file path. including '\\' or '/'
        // 
        int get_process_path( char * pszPath, int nLen, int * pnLenNeeded );

        // 
        // append path in all platform
        // 
        int path_append( char * lpszPath, const char * lpszAdder );

        // 
        // create guid
        // 
        int create_guid( char * lpszGuid );

        // 
        // sleep 1 / 1000 second
        // 
        int sleep( int nMilliseconds );

        // 
        // output debug info
        // 
        int out_put_debug_string( const char * lpszInfo );
        int out_put_to_cmd( const char * lpszInfo );
        int trace( const char * lpszFormat, ... );

        // 
        // get seconds from since 1970-1-1
        // 
        xos_u64 get_wall_second( xos_u64 * lpWallSecond );

        // 
        // get process ID
        // 
        xos_u64 get_current_process_id();

        // 
        // get thread ID
        // 
        xos_u64 get_current_thread_id();

        // 
        // get cpu num
        // 
        int get_cpu_num();

        // 
        // release
        // 
        int release();
    };
} // xos

#endif // __E7BE74E6_0971_4e10_9640_0B9C3654D28A__
